/*
 * XML Type:  NodeVisualModel
 * Namespace: http:///org/isistan/flabot/edit/editormodel.ecore
 * Java type: org.isistan.flabot.edit.editormodelEcore.NodeVisualModel
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.edit.editormodelEcore.impl;
/**
 * An XML NodeVisualModel(@http:///org/isistan/flabot/edit/editormodel.ecore).
 *
 * This is a complex type.
 */
public class NodeVisualModelImpl extends org.isistan.flabot.edit.editormodelEcore.impl.VisualModelImpl implements org.isistan.flabot.edit.editormodelEcore.NodeVisualModel
{
    private static final long serialVersionUID = 1L;
    
    public NodeVisualModelImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SOURCECONNECTIONS$0 = 
        new javax.xml.namespace.QName("", "sourceConnections");
    private static final javax.xml.namespace.QName TARGETCONNECTIONS$2 = 
        new javax.xml.namespace.QName("", "targetConnections");
    private static final javax.xml.namespace.QName ROTATION$4 = 
        new javax.xml.namespace.QName("", "rotation");
    
    
    /**
     * Gets array of all "sourceConnections" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] getSourceConnectionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(SOURCECONNECTIONS$0, targetList);
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] result = new org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "sourceConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel getSourceConnectionsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().find_element_user(SOURCECONNECTIONS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "sourceConnections" element
     */
    public int sizeOfSourceConnectionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SOURCECONNECTIONS$0);
        }
    }
    
    /**
     * Sets array of all "sourceConnections" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setSourceConnectionsArray(org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] sourceConnectionsArray)
    {
        check_orphaned();
        arraySetterHelper(sourceConnectionsArray, SOURCECONNECTIONS$0);
    }
    
    /**
     * Sets ith "sourceConnections" element
     */
    public void setSourceConnectionsArray(int i, org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel sourceConnections)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().find_element_user(SOURCECONNECTIONS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(sourceConnections);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "sourceConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel insertNewSourceConnections(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().insert_element_user(SOURCECONNECTIONS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "sourceConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel addNewSourceConnections()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().add_element_user(SOURCECONNECTIONS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "sourceConnections" element
     */
    public void removeSourceConnections(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SOURCECONNECTIONS$0, i);
        }
    }
    
    /**
     * Gets array of all "targetConnections" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] getTargetConnectionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TARGETCONNECTIONS$2, targetList);
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] result = new org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "targetConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel getTargetConnectionsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().find_element_user(TARGETCONNECTIONS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "targetConnections" element
     */
    public int sizeOfTargetConnectionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TARGETCONNECTIONS$2);
        }
    }
    
    /**
     * Sets array of all "targetConnections" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setTargetConnectionsArray(org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel[] targetConnectionsArray)
    {
        check_orphaned();
        arraySetterHelper(targetConnectionsArray, TARGETCONNECTIONS$2);
    }
    
    /**
     * Sets ith "targetConnections" element
     */
    public void setTargetConnectionsArray(int i, org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel targetConnections)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().find_element_user(TARGETCONNECTIONS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(targetConnections);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "targetConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel insertNewTargetConnections(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().insert_element_user(TARGETCONNECTIONS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "targetConnections" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel addNewTargetConnections()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel)get_store().add_element_user(TARGETCONNECTIONS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "targetConnections" element
     */
    public void removeTargetConnections(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TARGETCONNECTIONS$2, i);
        }
    }
    
    /**
     * Gets the "rotation" attribute
     */
    public java.lang.String getRotation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROTATION$4);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "rotation" attribute
     */
    public org.apache.xmlbeans.XmlString xgetRotation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROTATION$4);
            return target;
        }
    }
    
    /**
     * True if has "rotation" attribute
     */
    public boolean isSetRotation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(ROTATION$4) != null;
        }
    }
    
    /**
     * Sets the "rotation" attribute
     */
    public void setRotation(java.lang.String rotation)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ROTATION$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ROTATION$4);
            }
            target.setStringValue(rotation);
        }
    }
    
    /**
     * Sets (as xml) the "rotation" attribute
     */
    public void xsetRotation(org.apache.xmlbeans.XmlString rotation)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ROTATION$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(ROTATION$4);
            }
            target.set(rotation);
        }
    }
    
    /**
     * Unsets the "rotation" attribute
     */
    public void unsetRotation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(ROTATION$4);
        }
    }
}
